package com.wnxy.mapper;

import com.wnxy.pojo.Article;
import com.wnxy.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

public interface UserMapper {
    @Select("select * from users")
    List<User> findAll();

    @Insert("INSERT INTO users(name,age) values(#{name},#{age})")
    void add(User user);

    @Update("update users set name=#{name},age=#{age} where id=#{id}")
    void update(User user);

    @Delete("delete from users where id=#{id}")
    void delete(Integer id);

    void delBatch(@Param("ids") List<Integer> ids);

}
